<?php 
namespace App\Infra;

use App\Models\WeChatDoctor;
use App\Utils\ModelSDK\ModelOperator;
use App\Models\WeChatUser;

class WeChatManage{

	use ModelOperator;

	public function createUserInfo($data){
		$this->create(WeChatDoctor::class,$data);
	}

	public function updateUserStatus($conditions,$data){
		$this->getUserInfo($conditions)->update($data);
	}

	public function getUserInfo($conditions){
		return $this->findModel(WeChatDoctor::class,WeChatDoctor::query()->with(['wechatDoctorInfo']),$conditions,$first = true);
	}

	public function getUserInfoTwo($conditions){
		return $this->findModel(WeChatUser::class,WeChatUser::query()->with(['wechatUserInfo']),$conditions,$first = true);
	}
}